import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { constantRouterMap } from '@/config/router.config'


// 路由模式
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: constantRouterMap as Array<RouteRecordRaw>,
    scrollBehavior(_to, _from, _savedPosition) {
        return {
            el: '#app',
            top: 0,
            behavior: 'smooth',
        }
    },
})

export default router